#/bin/bash

#检查更新
apt update

#软件更新
apt upgrade -y

#国内一键安装docker脚本
curl -sSL https://get.daocloud.io/docker | sh

#检查docker状态
systemctl status docker

#换源
cat << EOF >  /etc/docker/daemon.json
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/","https://hub-mirror.c.163.com","https://registry.docker-cn.com"],
"insecure-registries": ["10.0.0.12:5000"]
}
EOF

#重启docker服务
service docker restart

#查看docker信息
service docker restart

#部署指定位置
cd /root

#docker安装
docker run -dit \
-v $PWD/ql/config:/ql/config \
-v $PWD/ql/scripts:/ql/scripts \
-v $PWD/ql/repo:/ql/repo \
-v $PWD/ql/log:/ql/log \
-v $PWD/ql/db:/ql/db \
-v $PWD/ql/jbot:/ql/jbot \
-v $PWD/ql/raw:/ql/raw \
-p 5700:5700 \
-e ENABLE_HANGUP=true \
-e ENABLE_WEB_PANEL=true \
--name qinglong \
--hostname qinglong \
--restart always \
whyour/qinglong:latest